package com.hzhc.controller.chargeBill;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hzhc.annotation.SysTemLog;
import com.hzhc.common.BaseController;
import com.hzhc.enumBean.ResultUtilCodeEnum;
import com.hzhc.service.CntrChargeDetailService;
import com.hzhc.utils.ResultUtil;
import com.hzhc.vo.CntrChargeDetailVo;
import lombok.RequiredArgsConstructor;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 集装箱计费明细 前端控制器
 * </p>
 *
 * @author 功不唐捐
 * @since 2024-06-12
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/cntrChargeDetail")
public class CntrChargeDetailController extends BaseController {

    private final CntrChargeDetailService cntrChargeDetailService;
    /**
     * 流水页面列表
     */
    @RequestMapping("/getAllChargeDetail")
    @ResponseBody
    public ResultUtil<List<CntrChargeDetailVo>> getAllChargeDetail(@RequestBody CntrChargeDetailVo vo) {
        Page<CntrChargeDetailVo> pagination = new Page<>(vo.getPageIndex(), vo.getPageSize());
        List<CntrChargeDetailVo> cntrChargeDetailVos = cntrChargeDetailService.getAllChargeDetail(vo, pagination);
        return ResultUtil.build(cntrChargeDetailVos, pagination.getTotal(),pagination.getPages(), ResultUtilCodeEnum.SUCCESS);
    }


    @PostMapping("/editPriceRet")
    @SysTemLog(operModul = "计费管理-费用流水修改费用", operType = "修改", operDesc = "费用流水修改费用功能", modular = "PC")
    public ResultUtil<T> editPriceRet(HttpServletRequest request, @RequestBody CntrChargeDetailVo vo) {
        return cntrChargeDetailService.editPriceRet(request,vo);
    }

}
